﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Lib.Controls;
using System.Data;
using Lib.Utilities;
public partial class f_dky_lich_hoc : fpage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                ScriptManager.GetCurrent(this).Services.Add(new ServiceReference("~/Service/wht_nsd.svc"));
                ScriptManager.GetCurrent(this).Services.Add(new ServiceReference("~/Service/wdt_ma.svc"));

                DataTable b_dt = new DataTable();
                LibTable.AddNewColumns(ref b_dt, new string[] { "MA", "TEN" });
                LibTable.AddNewRows(ref b_dt, new object[] { "HKI", "Học kỳ I" });
                LibTable.AddNewRows(ref b_dt, new object[] { "HKII", "Học kỳ II" });
                hocky.DataSource = b_dt;
                hocky.DataBind();

                namhoc.DataSource = dm_dt.FDM_NAM_LKE();
                namhoc.DataBind();
                if (namhoc.SelectedValue != null)
                {
                    DataTable b_dt_nam = dm_dt.Fdt_DK_HOC_LKE(LibConvert.ObjectToDouble(namhoc.SelectedValue), hocky.SelectedValue);
                    dk_hoc.DataSource = b_dt_nam;
                }
            }
        }
        catch(Exception ex)
        {
            LibForm.Msg(this.Page, ex.Message);
        }
    }
}